package com.company.OfferGuide;

import java.util.Arrays;

public class 数组中重复的数字 {

    public int findRepeatNumber(int[] nums) {
        Arrays.sort(nums);
        for (int i = 0; i < nums.length - 1; i++) {
            int j = i+1;
            if (nums[i] == nums[j]) return nums[i];
        }

        return -1;

    }

}
